class Solution {
public:
    vector<vector<int> > combine(int n, int k) {
        // Start typing your C/C++ solution below
        // DO NOT write int main() function

    	vector<int> record;
		vector<vector<int> > result;
		recursive(n, k, 1, record, result);
		return result;
	}

	void recursive(int n, int k, int start, vector<int>& record, vector<vector<int> >& result) {
		if (record.size() == k) {
			result.push_back(record);
			return;
		}
		for (int i = start; i <= n; ++i) {
			record.push_back(i);
			recursive(n, k, i + 1, record, result);
			record.pop_back();
		}
	}
};